package com.heima.feign.article;

import com.heima.feign.article.fallback.ArticleClientFallback;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.article.pojos.ApArticleConfig;
import com.heima.model.comment.dtos.CommentConfigDto;
import com.heima.model.comment.dtos.CommentNewsQueryDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.StatisticsDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

/**
 * @author jack
 * @data 2024 15:12
 */
@FeignClient(value = "leadnews-article",fallback = ArticleClientFallback.class)
public interface IArticleClient {

    /**
     * 新增或修改app文章信息
     * @param articleDto
     * @return
     */
    @PostMapping("/api/v1/article/saveOrUpdate")
    ResponseResult saveArticle(@RequestBody ArticleDto articleDto);

    /**
     * 功能描述：分页查询文章评论
     *
     * @param dto
     * @return {@link ResponseResult }
     * @author sungang
     * @date 2024/01/27  14:38
     */

    @PostMapping("api/v1/article/findNewsComments")
    PageResponseResult findnewsQueryComents(@RequestBody CommentNewsQueryDto dto);


    @PostMapping("api/v1/article/findById")
    ApArticleConfig findById(@RequestParam("articleId") Long articleId);


    @PostMapping("/api/v1/article/updateCommentStatus")
    public ResponseResult updateCommentStatus(@RequestBody CommentConfigDto dto);

    @PostMapping("/api/v1/article/newPage")
    PageResponseResult newPage(@RequestBody StatisticsDto dto);

    @PostMapping("/api/v1/article/")
    ResponseResult countAllDate(@RequestParam("wmUserId")Integer wmUserId, @RequestParam("beginDate") Date bDate ,@RequestParam("endDate")Date eDate);


}
